#ifndef BUSINESSLOGICCONTROLLER_H
#define BUSINESSLOGICCONTROLLER_H

#include <vector>
#include <boost/foreach.hpp>

#include "Helpers.h"
#include "CouncilMember.h"
#include "Committee.h"
#include "Session.h"

class ObjectModel;

class BusinessLogicController
{
public:
  BusinessLogicController(ObjectModel& model):
    m_model(model)
  {
  }

  std::vector<CouncilMember> currentCommitteeMembers(const Committee& committee);  
  CouncilMember getCurrentCommetteeChairmanship(const Committee& committee);
  std::vector<CouncilMember> getLatest10YearsChairmen(const Committee& committee);
  std::vector<time_t> chairmenEntryDatesByCommittee(const Committee& committee);
  std::vector<Committee> committeesByMember(const CouncilMember& member);
  int getSessionCount(const Committee& committee, const time_t startDate, const time_t endDate);
  std::string addCommittee(const std::string& committeeAim, const std::string& chairmanId);
  std::string listOfAbsence(const Committee& committee, const time_t startDate, const time_t endDate);
  std::vector<CouncilMember> committeeMembersWithinDateRange(const Committee& committee,
    time_t startDate, time_t endDate);
  std::vector<Session> committeeSessionsWithinDateRange(const Committee& committee, time_t startDate, time_t endDate);
  bool memberWasAbsent(const Session& session, const CouncilMember& member);
  std::string addSession(time_t date, const Committee& committee, std::vector<CouncilMember> members);
private:
  ObjectModel &m_model;
};

#endif // BUSINESSLOGICCONTROLLER_H